Skip to content

fix(onboard-openneuro): dedup-skip existing datasets (refs #450, #448) - #456

Merged
neuromechanist merged 1 commit into
devfrom
fix/issue-450-followup-onboard-dedup
May 13, 2026
Merged

neuromechanist merged 1 commit into
devfrom
fix/issue-450-followup-onboard-dedup

Conversation

@neuromechanist

Copy link
Copy Markdown
Contributor

Summary

`parse-ids` now pre-filters the matrix to skip any `ds######` whose `on######` counterpart already exists on `nemarDatasets` with non-empty contents. Empty shells (size==0, the #450 recovery state) are kept so operators can re-import after deletion.

Why

Until #448 (proper "update existing OpenNeuro dataset" command) lands, re-importing a live dataset clobbers state. Yesterday's run 25769577607 caught this on `ds003800` and `ds007315` — both had successful prior imports, the re-attempt failed at `git annex initremote` because the S3 bucket carried the prior annex-uuid. The current importer's "Dataset already exists, continuing..." path barrels through enough state to do damage. Cleaner to never matrix-spawn for those IDs.

Behaviour

  • `HTTP 404` on `nemarDatasets/on$N` → keep, normal import path
  • `HTTP 200` with `size == 0` → keep, treated as recoverable empty shell
  • `HTTP 200` with `size > 0` → skip with a `::warning::` pointing to the proper recovery commands
  • Any other HTTP status → `::error::` + fail-closed (don't silently dedup on transient API failure)
  • All-IDs-skipped → fail with an actionable error

Uses `NEMAR_GITHUB_PAT` (the existing workflow secret) because nemarDatasets dataset repos are private.

Test plan

  • Deploy to `nemarDatasets/.github/workflows/onboard-openneuro.yml` after merge.
  • Dispatch with an already-imported `ds*` ID → expect skip warning, no matrix job.
  • Dispatch with a fresh `ds*` ID → expect matrix job runs normally.
  • Dispatch with a mix → expect partial matrix.

Refs #450 #448

parse-ids now pre-filters the matrix to skip any ds###### whose on######
counterpart already exists on nemarDatasets with non-empty contents.
Empty shells (size==0, e.g. the #450 recovery state from run 25769577607)
are still kept so operators can re-import after deleting them.

Motivation: until #448 (proper 'update existing OpenNeuro dataset'
command) lands, re-importing a live dataset clobbers state. Yesterday's
run 25769577607 caught this on ds003800 and ds007315 — both had been
successfully onboarded earlier, the re-attempt failed at git-annex
S3 initremote because the bucket already carried the prior annex-uuid.
The current importer's 'Dataset already exists, continuing...' path
silently barrels through enough state to do damage; the cleaner fix is
to never matrix-spawn for those IDs in the first place.

Uses NEMAR_GITHUB_PAT (the existing workflow secret) because nemarDatasets
dataset repos are private.

Refs #450 #448
@github-actions

Copy link
Copy Markdown

📦 Package Preview

Your package is ready to test!

bun install -g nemar-cli@PR456

Version: 0.8.13-PR456.7ff9455
Commit: 7ff9455


🤖 Updated on each push.

@neuromechanist
neuromechanist merged commit 8e32b09 into dev May 13, 2026
8 checks passed
@neuromechanist
neuromechanist deleted the fix/issue-450-followup-onboard-dedup branch May 13, 2026 06:51

This branch was previously deployed

1 inactive deployment
npm — 7ff9455d Deployed May 13, 2026 by neuromechanist via publish #787
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant